# Copyright 2020 The ElasticDL Authors. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

STANDARDIZED_FEATURES = [
    "I1",
    "I2",
    "I3",
    "I4",
    "I5",
    "I6",
    "I7",
    "I8",
    "I9",
    "I10",
    "I11",
    "I12",
    "I13",
]

FEATURES_AVGS = {
    "I1": 1.913844818114358,
    "I2": 105.85781137082337,
    "I3": 21.179428578076866,
    "I4": 5.735273873448716,
    "I5": 18067.71807784242,
    "I6": 90.08603360120591,
    "I7": 15.626512199091756,
    "I8": 12.509966404126569,
    "I9": 101.53250047174322,
    "I10": 0.3374528968790535,
    "I11": 2.614521353031052,
    "I12": 0.23277149534177055,
    "I13": 6.436560081179827,
}

FEATURES_STDDEVS = {
    "I1": 7.203044443387521,
    "I2": 391.73147156506417,
    "I3": 354.59360229869503,
    "I4": 8.351369642571008,
    "I5": 68611.11705989522,
    "I6": 340.20415627271075,
    "I7": 64.82617180501207,
    "I8": 16.71389239615237,
    "I9": 216.67850042198575,
    "I10": 0.5918310609867024,
    "I11": 5.115695237395591,
    "I12": 2.7609291491203973,
    "I13": 14.799688705863462,
}
FEATURE_BOUNDARIES = {
    "I1": [0.0, 1.0, 2.0, 5.0],
    "I2": [-1.0, 0.0, 1.0, 1.0, 3.0, 8.0, 23.0, 56.0, 184.0],
    "I3": [0.0, 1.0, 2.0, 4.0, 6.0, 10.0, 17.0, 36.0],
    "I4": [0.0, 1.0, 2.0, 3.0, 4.0, 6.0, 9.0, 16.0],
    "I5": [5.0, 79.0, 622.0, 1408.0, 2687.0, 4363.0, 7381.0, 13433.0, 33163.0],
    "I6": [0.0, 1.0, 7.0, 16.0, 30.0, 54.0, 98.0, 216.0],
    "I7": [0.0, 1.0, 2.0, 3.0, 5.0, 8.0, 15.0, 32.0],
    "I8": [0.0, 2.0, 3.0, 5.0, 7.0, 11.0, 16.0, 23.0, 34.0],
    "I9": [1.0, 5.0, 12.0, 21.0, 35.0, 54.0, 82.0, 134.0, 255.0],
    "I10": [0.0, 1.0],
    "I11": [0.0, 1.0, 2.0, 3.0, 6.0],
    "I12": [0.0],
    "I13": [0.0, 1.0, 2.0, 3.0, 4.0, 6.0, 10.0, 18.0],
}


BUCKET_FEATURES = [
    "I1",
    "I2",
    "I3",
    "I4",
    "I5",
    "I6",
    "I7",
    "I8",
    "I9",
    "I10",
    "I11",
    "I12",
    "I13",
]

HASH_FEATURES = [
    "C1",
    "C2",
    "C3",
    "C4",
    "C5",
    "C6",
    "C7",
    "C8",
    "C9",
    "C10",
    "C11",
    "C12",
    "C13",
    "C14",
    "C15",
    "C16",
    "C17",
    "C18",
    "C19",
    "C20",
    "C21",
    "C22",
    "C23",
    "C24",
    "C25",
    "C26",
]

FEATURE_DISTINCT_COUNT = {
    "C1": 1460,
    "C2": 582,
    "C3": 9264260,
    "C4": 2046299,
    "C5": 305,
    "C6": 24,
    "C7": 12506,
    "C8": 633,
    "C9": 3,
    "C10": 91211,
    "C11": 5670,
    "C12": 7659856,
    "C13": 3194,
    "C14": 27,
    "C15": 14876,
    "C16": 5031503,
    "C17": 10,
    "C18": 5624,
    "C19": 2171,
    "C20": 4,
    "C21": 6477624,
    "C22": 18,
    "C23": 15,
    "C24": 272811,
    "C25": 105,
    "C26": 138075,
}

FEATURE_NAMES = STANDARDIZED_FEATURES + HASH_FEATURES

LABEL_KEY = "label"

FEATURE_GROUPS = [
    ["I1"],
    ["I2"],
    ["I3"],
    ["I5"],
    ["I6"],
    ["I7"],
    ["I8"],
    ["I9"],
    ["I10"],
    ["I11"],
    ["I12"],
    ["I13"],
    ["C1"],
    ["C2"],
    ["C3"],
    ["C4"],
    ["C5"],
    ["C6"],
    ["C7"],
    ["C8"],
    ["C9"],
    ["C10"],
    ["C11"],
    ["C12"],
    ["C13"],
    ["C14"],
    ["C15"],
    ["C16"],
    ["C17"],
    ["C18"],
    ["C19"],
    ["C20"],
    ["C21"],
    ["C22"],
    ["C23"],
    ["C24"],
    ["C25"],
    ["C26"],
]
